//
//  PatientOtherInfoCell.m
//  Doctor
//
//  Created by 阳光 on 16/9/13.
//  Copyright © 2016年 阳光. All rights reserved.
//

#import "PatientOtherInfoCell.h"

@interface PatientOtherInfoCell ()

// 丈夫生育状况
@property(nonatomic,strong)UIButton *husbandBtn;

@property(nonatomic,strong)UIView *husbandLine;

// 不孕治疗
@property(nonatomic,strong)UIButton *sickBtn;

@property(nonatomic,strong)UIView *sickLine;

// 你做过几次助孕治疗周期
@property(nonatomic,strong)UIButton *timesBtn;
//@property(nonatomic,strong)UILabel *timesLabel;

@property(nonatomic,strong)UIView *timesLine;

// 您悬着试管的目的
@property(nonatomic,strong)UILabel *aimLabel;

@property(nonatomic,strong)UIView *aimLine;


@end

@implementation PatientOtherInfoCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor=WhiteColor;
        
        self.husbandBtn.hidden=NO;
        self.husbandLine.hidden=NO;
        
        self.sickBtn.hidden=NO;
        self.sickLine.hidden=NO;
        
        self.timesBtn.hidden=NO;
        self.timesLine.hidden=NO;
        
        self.aimLabel.font=Font_Number(16);
        self.aimLine.hidden=NO;
        
    };
    return self;
}

// husbandBtn
-(UIButton *)husbandBtn
{
    if (!_husbandBtn) {
        _husbandBtn=[UIButton new];
        [_husbandBtn setImage:[UIImage imageNamed:@"cell_arrow"] forState:0];
        [self.contentView addSubview:_husbandBtn];
        
        UILabel *husbandLabel=[self getLabelWithText:NSLocalizedString(@"Husband Fertility", nil) font:Font_Number(16) textColor:Color666666 textAlignment:NSTextAlignmentLeft lineBreakMode:NSLineBreakByCharWrapping numberOfLines:1];
        [self.contentView addSubview:husbandLabel];
        
        [husbandLabel mas_makeConstraints:^(MASConstraintMaker *make) {
           make.top.left.mas_equalTo(kmargin);
        }];
        
        [_husbandBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(kmargin);
            make.right.mas_equalTo(-kmargin);
            make.size.mas_equalTo(CGSizeMake(kmargin*5/2,kmargin*5/2));
        }];
        [_husbandBtn addTarget:self action:@selector(husbandBtnEvent) forControlEvents:UIControlEventTouchUpInside];
    }
    return _husbandBtn;
}


-(UIView *)husbandLine
{
    if (!_husbandLine) {
        _husbandLine=[UIView new];
        _husbandLine.backgroundColor=MAIN_BACK_COLOR;
        [self.contentView addSubview:_husbandLine];
        [_husbandLine mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.husbandBtn.mas_bottom).offset(kmargin);
            make.left.mas_equalTo(kmargin);
            make.right.mas_equalTo(-kmargin);
            make.height.mas_equalTo(1);
        }];
    }
    return _husbandLine;
}

// sickBtn
-(UIButton *)sickBtn
{
    if (!_sickBtn) {
        _sickBtn=[UIButton new];
        [_sickBtn setImage:[UIImage imageNamed:@"cell_arrow"] forState:0];
        [self.contentView addSubview:_sickBtn];
        
        UILabel *sickLabel=[self getLabelWithText:NSLocalizedString(@"Infertility Treatment", nil) font:Font_Number(16) textColor:Color666666 textAlignment:NSTextAlignmentLeft lineBreakMode:NSLineBreakByCharWrapping numberOfLines:1];
        [self.contentView addSubview:sickLabel];
        
        [sickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(kmargin);
            make.top.mas_equalTo(self.husbandLine.mas_bottom).offset(kmargin);
        }];
        
        [_sickBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.husbandLine.mas_bottom).offset(kmargin);
            make.right.mas_equalTo(-kmargin);
            make.size.mas_equalTo(CGSizeMake(kmargin*5/2,kmargin*5/2));
        }];
        [_sickBtn addTarget:self action:@selector(sickBtnEvent) forControlEvents:UIControlEventTouchUpInside];
    }
    return _sickBtn;
}



-(UIView *)sickLine
{
    if (!_sickLine) {
        _sickLine=[UIView new];
        _sickLine.backgroundColor=MAIN_BACK_COLOR;
        [self.contentView addSubview:_sickLine];
        [_sickLine mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.sickBtn.mas_bottom).offset(kmargin);
            make.left.mas_equalTo(kmargin);
            make.right.mas_equalTo(-kmargin);
            make.height.mas_equalTo(1);
        }];
    }
    return _sickLine;
}

// timesBtn
-(UIButton *)timesBtn
{
    if (!_timesBtn) {
        _timesBtn=[UIButton new];
        [_timesBtn setImage:[UIImage imageNamed:@"cell_arrow"] forState:0];
        [self.contentView addSubview:_timesBtn];
        
        UILabel *sickLabel=[self getLabelWithText:NSLocalizedString(@"Infertility Treatment", nil) font:Font_Number(16) textColor:Color666666 textAlignment:NSTextAlignmentLeft lineBreakMode:NSLineBreakByCharWrapping numberOfLines:1];
        [self.contentView addSubview:sickLabel];
        
        [sickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(kmargin);
            make.top.mas_equalTo(self.husbandLine.mas_bottom).offset(kmargin);
        }];
        
        [_sickBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.husbandLine.mas_bottom).offset(kmargin);
            make.right.mas_equalTo(-kmargin);
            make.size.mas_equalTo(CGSizeMake(kmargin*5/2,kmargin*5/2));
        }];
        [_sickBtn addTarget:self action:@selector(sickBtnEvent) forControlEvents:UIControlEventTouchUpInside];
    }
    return _sickBtn;
}

//// timesLabel
//-(UILabel *)timesLabel
//{
//    if (!_timesLabel) {
//        _timesLabel=[self getLabelWithText:@"无" font:Font_Number(16) textColor:Color333333 textAlignment:NSTextAlignmentRight lineBreakMode:NSLineBreakByCharWrapping numberOfLines:1];
//        [self.contentView addSubview:_timesLabel];
//        
//        UILabel *leftAbortionLabel=[self getLabelWithText:@"您做过几次助孕治疗周期" font:Font_Number(16) textColor:Color666666 textAlignment:NSTextAlignmentLeft lineBreakMode:NSLineBreakByCharWrapping numberOfLines:1];
//        [self.contentView addSubview:leftAbortionLabel];
//        
//        [leftAbortionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.left.mas_equalTo(kmargin);
//            make.top.mas_equalTo(self.sickLine.mas_bottom).offset(kmargin);
//        }];
//        
//        [_timesLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.top.mas_equalTo(self.sickLine.mas_bottom).offset(kmargin);
//            make.right.mas_equalTo(-kmargin);
//        }];
//    }
//    return _timesLabel;
//}

//-(UIView *)timesLine
//{
//    if (!_timesLine) {
//        _timesLine=[UIView new];
//        _timesLine.backgroundColor=MAIN_BACK_COLOR;
//        [self.contentView addSubview:_timesLine];
//        [_timesLine mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.top.mas_equalTo(self.timesLabel.mas_bottom).offset(kmargin);
//            make.left.mas_equalTo(kmargin);
//            make.right.mas_equalTo(-kmargin);
//            make.height.mas_equalTo(1);
//        }];
//    }
//    return _timesLine;
//}
//
//// aimLabel
//-(UILabel *)aimLabel
//{
//    if (!_aimLabel) {
//        _aimLabel=[self getLabelWithText:@"无" font:Font_Number(16) textColor:Color333333 textAlignment:NSTextAlignmentRight lineBreakMode:NSLineBreakByCharWrapping numberOfLines:1];
//        [self.contentView addSubview:_aimLabel];
//        
//        UILabel *leftExfetationLabel=[self getLabelWithText:@"您悬着试管的目的" font:Font_Number(16) textColor:Color666666 textAlignment:NSTextAlignmentLeft lineBreakMode:NSLineBreakByCharWrapping numberOfLines:1];
//        [self.contentView addSubview:leftExfetationLabel];
//        
//        [leftExfetationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.left.mas_equalTo(kmargin);
//            make.top.mas_equalTo(self.timesLine.mas_bottom).offset(kmargin);
//        }];
//        
//        [_aimLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.top.mas_equalTo(self.timesLine.mas_bottom).offset(kmargin);
//            make.right.mas_equalTo(-kmargin);
//        }];
//    }
//    return _aimLabel;
//}
//
//-(void)husbandBtnEvent
//{
//    if([self.delegate respondsToSelector:@selector(husbandBtnEvent)])
//    {
//        [self.delegate husbandBtnEvent];
//    }
//}
//
//-(void)sickBtnEvent
//{
//    if([self.delegate respondsToSelector:@selector(sickBtnEvent)])
//    {
//        [self.delegate sickBtnEvent];
//    }
//}
//
//
//-(void)setPatientInfoDic:(NSDictionary *)patientInfoDic
//{
//    _patientInfoDic=patientInfoDic;
//    
//    
//    _aimLabel.text=patientInfoDic[@"shiguanmudi"];
//}
//
@end
